# -*- coding: utf-8 -*-
import os
from time import sleep
from selenium import webdriver
from selenium.common.exceptions import NoSuchElementException
from selenium.webdriver.common.action_chains import ActionChains
from selenium.webdriver.common.by import By
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.support.wait import WebDriverWait
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.support.wait import WebDriverWait
import urllib;
import urllib2;
import cookielib;
class Login():
    def __init__(self):
        self.username='';
        self.password='';
        self.url='';
        self.cookie='';
    def login(self):
        cookie = cookielib.CookieJar()
        handler = urllib2.HTTPCookieProcessor(cookie)
        opener = urllib2.build_opener(handler)
        data=self.getfromdata();
        response=opener.open(fullurl='',data=data);
        self.cookie=cookie;
        return ;
    def getfromdata(self):
        data=urllib.urlencode({
            'username':self.username,
            'password':self.password
        });
        return data;


